package com.navi.loaddata.core.mesEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by Jay on 2018/3/17.
 */
@Entity
@Table(name = "MES_NODE", schema = "P1RPTADM", catalog = "")
public class MesNode {
    private String nodeid;
    private String nodetype;
    private String nodeattribute1;
    private String nodeattribute2;
    private Long xcoordinate;
    private Long ycoordinate;
    private String factoryname;
    private String processflowname;
    private String processflowversion;
    private Date updatetime;

    @Id
    @Column(name = "NODEID")
    public String getNodeid() {
        return nodeid;
    }

    public void setNodeid(String nodeid) {
        this.nodeid = nodeid;
    }

    @Basic
    @Column(name = "NODETYPE")
    public String getNodetype() {
        return nodetype;
    }

    public void setNodetype(String nodetype) {
        this.nodetype = nodetype;
    }

    @Basic
    @Column(name = "NODEATTRIBUTE1")
    public String getNodeattribute1() {
        return nodeattribute1;
    }

    public void setNodeattribute1(String nodeattribute1) {
        this.nodeattribute1 = nodeattribute1;
    }

    @Basic
    @Column(name = "NODEATTRIBUTE2")
    public String getNodeattribute2() {
        return nodeattribute2;
    }

    public void setNodeattribute2(String nodeattribute2) {
        this.nodeattribute2 = nodeattribute2;
    }

    @Basic
    @Column(name = "XCOORDINATE")
    public Long getXcoordinate() {
        return xcoordinate;
    }

    public void setXcoordinate(Long xcoordinate) {
        this.xcoordinate = xcoordinate;
    }

    @Basic
    @Column(name = "YCOORDINATE")
    public Long getYcoordinate() {
        return ycoordinate;
    }

    public void setYcoordinate(Long ycoordinate) {
        this.ycoordinate = ycoordinate;
    }

    @Basic
    @Column(name = "FACTORYNAME")
    public String getFactoryname() {
        return factoryname;
    }

    public void setFactoryname(String factoryname) {
        this.factoryname = factoryname;
    }

    @Basic
    @Column(name = "PROCESSFLOWNAME")
    public String getProcessflowname() {
        return processflowname;
    }

    public void setProcessflowname(String processflowname) {
        this.processflowname = processflowname;
    }

    @Basic
    @Column(name = "PROCESSFLOWVERSION")
    public String getProcessflowversion() {
        return processflowversion;
    }

    public void setProcessflowversion(String processflowversion) {
        this.processflowversion = processflowversion;
    }

    @Basic
    @Column(name = "UPDATETIME")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MesNode mesNode = (MesNode) o;

        if (nodeid != null ? !nodeid.equals(mesNode.nodeid) : mesNode.nodeid != null) return false;
        if (nodetype != null ? !nodetype.equals(mesNode.nodetype) : mesNode.nodetype != null) return false;
        if (nodeattribute1 != null ? !nodeattribute1.equals(mesNode.nodeattribute1) : mesNode.nodeattribute1 != null)
            return false;
        if (nodeattribute2 != null ? !nodeattribute2.equals(mesNode.nodeattribute2) : mesNode.nodeattribute2 != null)
            return false;
        if (xcoordinate != null ? !xcoordinate.equals(mesNode.xcoordinate) : mesNode.xcoordinate != null) return false;
        if (ycoordinate != null ? !ycoordinate.equals(mesNode.ycoordinate) : mesNode.ycoordinate != null) return false;
        if (factoryname != null ? !factoryname.equals(mesNode.factoryname) : mesNode.factoryname != null) return false;
        if (processflowname != null ? !processflowname.equals(mesNode.processflowname) : mesNode.processflowname != null)
            return false;
        if (processflowversion != null ? !processflowversion.equals(mesNode.processflowversion) : mesNode.processflowversion != null)
            return false;
        if (updatetime != null ? !updatetime.equals(mesNode.updatetime) : mesNode.updatetime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = nodeid != null ? nodeid.hashCode() : 0;
        result = 31 * result + (nodetype != null ? nodetype.hashCode() : 0);
        result = 31 * result + (nodeattribute1 != null ? nodeattribute1.hashCode() : 0);
        result = 31 * result + (nodeattribute2 != null ? nodeattribute2.hashCode() : 0);
        result = 31 * result + (xcoordinate != null ? xcoordinate.hashCode() : 0);
        result = 31 * result + (ycoordinate != null ? ycoordinate.hashCode() : 0);
        result = 31 * result + (factoryname != null ? factoryname.hashCode() : 0);
        result = 31 * result + (processflowname != null ? processflowname.hashCode() : 0);
        result = 31 * result + (processflowversion != null ? processflowversion.hashCode() : 0);
        result = 31 * result + (updatetime != null ? updatetime.hashCode() : 0);
        return result;
    }
}
